<template>
  <div class="right-nav">
    <div class="nav">
      <div class="nav1">
        <div><img src="/img/login/r-nav1.png"></div>
        <div class="hover_nav1">
          <div><img src="/img/login/people.gif"></div>
          <div>
            <span>您好! 请 </span>
            <router-link to="/login">登录</router-link>
            <router-link to="/register">注册</router-link>
          </div>
        </div>
      </div>
      <div class="nav2">
        <div><img src="/img/login/r-nav2.png">
        <div class="mt_5">购</div>
        <div class="mt_5" >物</div>
        <div class="mt_5" >车</div>
        <div class="mt_5 mt_5_border">
          <span>{{cartcount}}</span>
        </div>
      </div>
      </div>
      <div class="nav3">
        <div><img src="/img/login/r-nav3.png"></div>
      </div>
      <div class="nav4">
        <div><img src="/img/login/r-nav4.png"></div>
      </div>
      <div class="nav5">
        <div><img src="/img/login/r-nav5.png"></div>
      </div>
      <div class="nav6">
        <div><img src="/img/login/r-nav6.png"></div>
      </div>
      <div class="nav7">
        <div><img src="/img/login/r-nav7.png"></div>
      </div>
      <div class="nav8">
        <div>
          <router-link to="#"><img src="/img/login/r-nav8.png" @click="totop"></router-link>
        </div>
        <div class="hover_nav8" @click="totop">返回顶部</div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  data(){
    return {
      
    }
  },
  methods:{
    totop(){
      window.scrollTo(0,0)
    }
  },
  computed:{
    ...mapState(['count2']),
    cartcount(){
      return this.count2;
    }
  }
}
</script>

<style scoped>
.right-nav .nav{
  width: 36px;
  height: 100%;
  background-color: #666;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
}
.mt_5{
  margin-top: 5px;
}
.mt_5_border{
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: 8px;
  line-height: 21px;
  background-color: #cd625d;
}
.hover_nav1{
  position: absolute;
  right: 36px;
  height: 132px;
  width: 200px;
  background-color: #eee;
  z-index: 5;
  margin-top: -25px;
  font-size: 14px;
  display: none;
}
.hover_nav1 div{
  margin-top: 11px;
}
.hover_nav1 a {
  color: #fc554c;
  font-size: 14px;
  margin-left: 10px;
}
.right-nav .nav1{
  margin-top: 140px;
}
.right-nav .nav1:hover .hover_nav1{
  display: block;
}
.right-nav .nav2{   /*购物车图标*/
  margin-top: 32px;
  color: #fff;
  font-size: 12px;
}
.right-nav .nav3{
  margin-top: 32px;
}
.right-nav .nav4{
  margin-top: 20px;
}
.right-nav .nav5{
  margin-top: 20px;
}
.right-nav .nav6{
  margin-top: 330px;
}
.right-nav .nav7{
  margin-top: 12px;
}
.right-nav .nav8{
  margin-top: 12px;
}
.right-nav .nav8:hover .hover_nav8{
  display: block;
}
.hover_nav8{
  position: absolute;
  width: 120px;
  height: 35px;
  color: #fff;
  background-color: #000;
  right: 36px;
  line-height: 35px;
  bottom: 47px;
  font-size: 14px;
  display: none;
  cursor: pointer;
  border-top-left-radius: 5px;
  border-bottom-left-radius: 5px;
}



</style>